﻿using System;
using System.Collections.Generic;

namespace Labthink.PCSoft.UniversalHost4.Model.User
{
    public class User
    {
        /// <summary>
        /// 登录名
        /// </summary>
        public string LoginName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }

        /// <summary>
        /// 新密码
        /// </summary>
        public string NewPwd { get; set; }
    }

    /// <summary>
    /// 对应ViewUser表
    /// </summary>
    public class UserInfo : User
    {
        public int Id { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string Salt { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public int Gender { get; set; }

        /// <summary>
        /// 生日
        /// </summary>
        public DateTime? Birth { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email { get; set; }

        /// <summary>
        /// 电话
        /// </summary>
        public string Phone { get; set; }

        /// <summary>
        /// 角色
        /// </summary>
        public int Role { get; set; }

        /// <summary>
        /// 角色名称
        /// </summary>
        public string RoleName { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        public string Barcode { get; set; }

        /// <summary>
        /// 创建者
        /// </summary>
        public string Creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateDate { get; set; }

        /// <summary>
        /// 过期时间
        /// </summary>
        public DateTime? ExpiresDate { get; set; }

        /// <summary>
        /// 最后登录时间
        /// </summary>
        public DateTime? LastDate { get; set; }

        /// <summary>
        /// 锁定时间
        /// </summary>
        public DateTime? LockDate { get; set; }

        /// <summary>
        /// 是否第一次登陆
        /// </summary>
        public bool? IsFirst { get; set; }

        /// <summary>
        /// 是否锁定
        /// </summary>
        public bool? IsLock { get; set; }

        /// <summary>
        /// 是否已被删除
        /// </summary>
        public bool? IsDelete { get; set; }

        /// <summary>
        /// 上次输入错误时间
        /// </summary>
        public DateTime? LastErrorDate { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime? DeleteDate { get; set; }
    }

    public class UserAndPermission
    {
        public UserInfo Info { get; set; }

        public List<UserPermission> Permissions { get; set; }

        public bool IsControl { get; set; }
    }
}
